<!DOCTYPE html>  
<html>  
    <head>  
        <meta charset="UTF-8">  
        <title>时钟特效</title>  
    </head>  
    <script type="text/javascript">  
        function disptime(){  
            var today=new Date();  
			var yy=today.getFullYear();
			var mo=today.getMonth()+1;
			var dd=today.getDate();
            var hh=today.getHours();  
            var mm=today.getMinutes();  
            var ss = today.getSeconds();  
            document.getElementById("myclock").innerHTML="<h1>现在是—"+yy+"年"+mo+"月"+dd+"日"+hh+":"+mm+":"+ss+"</h1>"  
              
        }   
        //setInterval（）方法可以按照指定的周期调用函数或计算表达式  
        var mytime = setInterval("disptime()",1000);  
    </script>  
    <body onload="disptime()">  
        <div id="myclock"></div>  
    </body>  
</html>